#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main()
{
	int n,i,j,temp;
	scanf("%d",&n);
	int a[n];
	srand(time(NULL));

	for(i=0;i<n;i++)
	{
		a[i]=rand()%100;
		printf("%d ",a[i]);
	}
	printf("\n");

	for(i=0;i<=n/2;i++)
	{
		temp=a[i];
		a[i]=a[n-i-1];
		a[n-i-1]=temp;
	}

	for(i=0;i<n;i++)
		printf("%d ",a[i]);
	printf("\n");

}
